﻿@model Resto.CostControl.Core.TempDishOrder
<div class="pageContent">
    @using (Html.DWZBeginForm())
    { 
        <div class="pageFormContent" layouth="56">
            @Html.HiddenFor(model => model.Id)
            @Html.DWZTextBoxFor(model => model.Name).Required()
            @Html.DWZTextBoxFor(model => model.Code).Required()
            @Html.DWZTextBoxFor(model => model.TotalCost).Number().Required()
            @Html.DWZTextBoxFor(model => model.TotalPrice).Number().Required()
            @Html.DWZDropDownListFor(model => model.SiteId, "ProjectSite").Required()
            @Html.DWZTextBoxFor(model => model.ReportUserName).Required()
            @Html.DWZTextBoxFor(model => model.ReportDate).Required()
            <div class="divider">
            </div>
            <table class="list nowrap itemDetail" addbutton="新建菜肴" width="100%">
                <thead>
                    <tr>
                        <th type="lookup" name="dwz.details[#index#].Code" lookupgroup="details[#index#]"
                                        lookupurl="@Url.Action("LookupDish", "Dish")" size="8">
                            编号
                        </th>
                        <th type="text" name="dwz.details[#index#].Name" size="15" fieldclass="required">
                            名称
                        </th>
                        <th type="text" name="dwz.details[#index#].Category" size="8">
                            类别
                        </th>
                        <th type="text" name="dwz.details[#index#].Count" size="6" fieldclass="number">
                            客数
                        </th>
                        <th type="text" name="dwz.details[#index#].DishCost" size="8">
                            成本价格
                        </th>
                        <th type="text" name="dwz.details[#index#].TotalCost" size="8">
                            成本总价
                        </th>
                        <th type="text" name="dwz.details[#index#].DishPrice" size="8">
                            销售价格
                        </th>
                        <th type="text" name="dwz.details[#index#].TotalPrice" size="8">
                            销售总价
                        </th>
                        <th type="del" width="25">
                            <hi:text key="操作" />
                        </th>
                    </tr>
                </thead>
                <tbody>
                    @for (int index = 0; index < Model.Details.Count; index++)
                    {
                        Resto.CostControl.Core.DishOrderItem item = Model.Details[index];
                        <tr class="unitBox">
                            <td>
                                @Html.Hidden("details[" + index + "].id", item.Id)
                                @Html.TextBox("dwz.details[" + index + "].Code", item.Code, new { size = "8" })
                                <a title="查找带回" lookupgroup="details[@index]" href="@Url.Action("LookupDish", "Dish")" class="btnLook">
                                    查找带回</a>
                            </td>
                            <td>
                                @Html.TextBox("dwz.details[" + index + "].Name", item.Name, new { size = "15" })
                            </td>
                            <td>
                                @Html.TextBox("dwz.details[" + index + "].Category", item.Category, new { size = "8" })
                            </td>
                            <td>
                                @Html.TextBox("dwz.details[" + index + "].Count", item.Count, new { size = "6" })
                            </td>
                            <td>
                                @Html.TextBox("dwz.details[" + index + "].DishCost", item.DishCost, new { size = "8" })
                            </td>
                            <td>
                                @Html.TextBox("dwz.details[" + index + "].TotalCost", item.TotalCost, new { size = "8" })
                            </td>
                            <td>
                                @Html.TextBox("dwz.details[" + index + "].DishPrice", item.DishPrice, new { size = "8" })
                            </td>
                            <td>
                                @Html.TextBox("dwz.details[" + index + "].TotalPrice", item.TotalPrice, new { size = "8" })
                            </td>
                            <td>
                                <a href="@Url.Action("DeleteItem")/@item.Id" class="btnDel" title="您确定要删除服务端的记录吗?">删除</a>
                            </td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
        @Html.DWZFormBar()
    }
</div>
